package com.yootk;
import java.io.File;
public class YootDemo5 {
    public static void main(String [] args)throws Exception{
        File file = new File("H:"+File.separator);
        info(file);
    }
    public static void info(File file){
        if (file.isDirectory()){
            File list[] = file.listFiles((f) -> f.isDirectory() ? true:
                    f.getName().endsWith(".txt"));
        if (list != null) {
            for (File temp : list) {
                info(temp);
            }
        }
        }else {
            System.out.println(file);
        }
    }
}
